{% extends "xadmin/views/model_form.html" %}
{% load i18n %}
{% load url from future %}
{% load xadmin_tags %}

{% block breadcrumbs %}
<ul class="breadcrumb">
  <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
  <li><a href="{% url opts|admin_urlname:'changelist' %}">{{opts.verbose_name_plural|capfirst}}</a> <span class="divider">/</span></li>
  <li><a href="{% url opts|admin_urlname:'change' object.pk %}">{{ object|truncatewords:"18" }}</a> <span class="divider">/</span></li>
  <li><a href="{% url opts|admin_urlname:'revisionlist' object.pk %}">{% trans 'History' %}</a> <span class="divider">/</span></li>
  <li class="active">{% blocktrans with opts.verbose_name as verbose_name %}Diff {{verbose_name}}{% endblocktrans %}</li>
</ul>
{% endblock %}

{% block content %}
<div class="navbar">
  <div class="navbar-inner">
    <a class="brand icon-time" href="#">{% blocktrans with opts.verbose_name as verbose_name %}Diff {{verbose_name}}{% endblocktrans %}</a>
  </div>
</div>
<div id="content-main">
<div class="module">
  <table id="change-diff" class="table table-bordered table-hover">
      <thead>
          <tr>
              <th scope="col">{% trans 'Field' %}</th>
              <th scope="col">{% trans 'Version A' %}</th>
              <th scope="col">{% trans 'Version B' %}</th>
          </tr>
      </thead>
      <tbody>
          {% for label, value_a, value_b, diff in diffs %}
              <tr{%if diff%} class="diff-row warning"{% endif %}>
                  <th scope="row">{{ label }}</th>
                  <td class="version-a{%if not diff%} muted{% endif %}">{{value_a}}</td>
                  <td class="version-b{%if not diff%} muted{% endif %}">{{value_b}}</td>
              </tr>
          {% endfor %}
              <tr>
                  <th scope="row">{% trans "Revert to" %}</th>
                  <td><a class="btn" href="{{revision_a_url}}"><i class="icon-undo"></i> {% trans 'Revert' %}</a></td>
                  <td><a class="btn" href="{{revision_b_url}}"><i class="icon-undo"></i> {% trans 'Revert' %}</a></td>
              </tr>
      </tbody>
  </table>
</div>
</div>
{% endblock %}